package com.bprogram.favorite.controller;


import com.bprogram.controller.UserFeign;
import com.bprogram.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author cai
 * @since 2023-11-21
 */
@RestController
@RequestMapping("/favorite")
public class FavoriteController {

    @Autowired
    private UserFeign userFeign;

    @PostMapping("/get")
    public void get() {
        List<User> list = userFeign.getAll();
        System.out.println(list);
    }

    @GetMapping("/set")
    public void set() {
        System.out.println("favorite-->userFeign");
        User user = userFeign.getUserByUserCode("666");
        System.out.println(user.toString());
    }

}

